package com.hutianao.gqgl.information.internationalQuote.service.impl;

import com.hutianao.gqgl.information.internationalQuote.entity.SearchInternationalQuoteEntity;
import com.hutianao.gqgl.information.internationalQuote.respository.InternationalQuoteDao;
import com.hutianao.gqgl.information.internationalQuote.service.InternationalQuoteService;
import com.hutianao.gqgl.mybatis.entity.InternationalQuoteEntity;
import com.hutianao.gqgl.mybatis.flexigrid.PaddingEntity;
import com.hutianao.gqgl.mybatis.flexigrid.PadingRstType;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class InternationalQuoteServiceImpl implements InternationalQuoteService {
    @Resource
    private InternationalQuoteDao InternationalQuoteDao;

    @Override
    public PadingRstType<InternationalQuoteEntity> queryInternationalQuoteInfoListByPage(SearchInternationalQuoteEntity search, PaddingEntity padding) {
        padding.deal(InternationalQuoteEntity.class);
        PadingRstType<InternationalQuoteEntity> padingRstType = new PadingRstType<>();
        padingRstType.setPage(padding.getPage());
        List<InternationalQuoteEntity> list = InternationalQuoteDao.queryInternationalQuoteInfoListByPage(search,padding);
        padingRstType.setRawRecords(list);
        Integer total = InternationalQuoteDao.queryInternationalQuoteInfoTotal(search);
        padingRstType.setTotal(total);
        padingRstType.putItems();

        return padingRstType;
    }
}
